const ObjId = require("../common/ObjId");

class PostCommentRequest {
    constructor(obj) {
        this.postId = obj.body.postId;
        this.lastPostCommentId = obj.body.lastPostCommentId;
    }

    check() {
        // 验证 id
        let post = new ObjId(this, 'postId');
        let flag = post.check();
        if (!flag.success) {
            return flag;
        }
        let lastPostComment = new ObjId(this, 'lastPostCommentId', true);
        flag = lastPostComment.check();
        if (!flag.success) {
            return flag;
        }
        return { success: true };
    }
}

module.exports = PostCommentRequest;